﻿function ResizeIFrame(contentHeight) {
    return;
    //alert("contentHeight:"+contentHeight);
    var stdQueryGrid = $("#StdQueryGrid > tbody > tr > td");

    var heightSum = 0;
    //alert("tabHeight:" + heightSum);
    var tableHeater = $("#StdQueryGrid_DXHeaderTable").parent();
    if (tableHeater.length == 1) {
        //alert("tableHeater:" + tableHeater.height());
        heightSum += tableHeater.height() + 1;
    }
    //    var sumFooter = $("#StdQueryGrid_DXFooterTable");
    //    if (sumFooter.length == 1) {
    //        //alert("sumFooter:" + sumFooter.height());
    //        heightSum += sumFooter.height() + 1;
    //    }

    var paperFooter = $("#StdQueryGrid_DXPagerBottom").parent();
    if (paperFooter.length == 1) {
        //alert("paperFooter:" + paperFooter.height());
        heightSum += paperFooter.height() + 1;
    } else {
        heightSum += 6;
    }

    var groupPanel = stdQueryGrid.children("[class*='dxgvGroupPanel']");
    if (groupPanel.length == 1) {
        //alert("groupPanel:" + groupPanel.height());
        heightSum += groupPanel.height() + 1;

    }

    var emptyRow = stdQueryGrid.children("[class*='dxgvEmptyDataRow']");
    if (emptyRow.length == 1) {
        //emptyRow.height(contentHeight - heightSum - 10);
    }
    else {
        var themeHeight = 0;
        switch ($("#hfThemeName").val()) {
            case "Default": themeHeight = 0;
                break;
            case "Aqua":
            case "Office2003Olive":
            case "Office2003Blue":
            case "Office2003Silver": themeHeight = 0; break;
            case "PlasticBlue": themeHeight = -2;break;
        }
        var height = contentHeight - heightSum - 3 - themeHeight;
        $("#StdQueryGrid_DXMainTable").parent().height(height);
    }
}
parent.parent.parent.parent.$().ResizeAll();

function InitGrid() {
//    var mainTable = $("#StdQueryGrid_DXMainTable").css('table-layout', 'auto');
//    mainTable.find("[id*='StdQueryGrid_DXDataRow'] td").css("border-width", "1px").children("div").remove();
//    $("#StdQueryGrid_DXMainTable").find("#StdQueryGrid_DXHeadersRow td").width("auto");
//    $("#StdQueryGrid_DXMainTable colgroup").remove();

//    var newTR = $("#StdQueryGrid_DXHeadersRow").clone();
//    newTR.css("position", "absolute");
//    $("#StdQueryGrid_DXHeadersRow").after(newTR);
//    var newTRTDs = newTR.find("td");
//    var TRTDs= $("#StdQueryGrid_DXHeadersRow > td");
//    TRTDs.each(function (e) {
//        newTRTDs.eq(e).width($(this).width()).css("position", "absolute");
//        if (e != 0) {
//            
//            newTRTDs.eq(e).css("margin-left", ($("#StdQueryGrid_DXHeadersRow > td:eq(" + (e - 1) + ")").width() + "px"));
//        }
//    })
    //    var firstDataRow = $("#StdQueryGrid_DXDataRow1 > td");
    //    if (firstDataRow.length != 0) {

    //        $("#StdQueryGrid_DXHeadersRow > td").each(function (e) {
    //            firstDataRow.eq(e).width((firstDataRow.eq(e).width()+1));
    //            $(this).width($(this).width());
    //            var tdWidth = firstDataRow.eq(e).width();

    ////            if (tdWidth > $(this).width()) {
    ////                $(this).width((tdWidth - 2));
    ////            } else {
    ////                firstDataRow.eq(e).width($(this).width());
    ////            }
    //        });
    //        $("#StdQueryGrid_DXHeadersRow").css("position", "absolute");
    //    }
    $(""#)
}
InitGrid();
//alert($('StdQueryGrid_DXMainTable').length);


